<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            height: 100px;
            background-color: skyblue;

            line-height: 100px;
        }
    </style>
</head>
<body>
    <!-- 垂直居中技巧：行高属性值等于盒子高度属性值（只适用于单行文字） -->
    <div>文<br>字</div>
</body>
</html>